<template>
  <div class="section">
    <picker mode="region" @change="bindRegionChange" :value="region">
      <div class="picker">
      {{changeregion || "请选择"}}
      </div>
    </picker>
  </div>
</template>
<script>
  export default {
    data(){
      return{
        region: []
      }
    },
    computed:{
      changeregion() {
        return this.region.join(' ')
      }
    },
    methods:{
      bindRegionChange (e){ //value改变时候触发
        this.region = e.mp.detail.value
        this.$emit("province",this.region[0])
        this.$emit("city",this.region[1])
        this.$emit("district",this.region[2])
      }
    }
  }
</script>
